package com.formation.userbase.persistance.services;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.formation.userbase.persistance.beans.User;
import com.formation.userbase.persistance.dao.UserDao;
import com.formation.userbase.persistance.dao.UserHibernateDao;
//import dao.UserJdbcDao;

@Service(value="userservicebean")
public class UserImplementService implements UserService {
	@Resource(name="userdaobean")
	UserDao monDao;
	
	
	public UserImplementService(){
		monDao=new UserHibernateDao();
	}
	
	
	

	public UserDao getMonDao() {
		return monDao;
	}




	public void setMonDao(UserDao monDao) {
		this.monDao = monDao;
	}




	@Override
	public User findUserByLogin(String Login) {
		// TODO Auto-generated method stub
		return monDao.findUserByLogin(Login);
	}

	@Override
	public boolean insert(User u) {
		// TODO Auto-generated method stub
		if(monDao.insert(u))
			return true;
		else
			return false;

	}
	
	@Override
	public List<User> getAllUser(){
		return monDao.getAllUser();
	}

}
